package edu.berkeley.drivingbuddy;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;



public class mainPage extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
    Button mButtonMainpageNewCourse;
    Button mButtonMainpageMyResults;
    Button mButtonMainpageFriends;
    Button mButtonMainpageDrivingSchool;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mButtonMainpageNewCourse = (Button) findViewById(R.id.button_mainpage_newcourse);
        mButtonMainpageMyResults = (Button) findViewById(R.id.button_mainpage_myresults);
        mButtonMainpageFriends = (Button) findViewById(R.id.button_mainpage_friends);
        mButtonMainpageDrivingSchool = (Button) findViewById(R.id.button_mainpage_goals);
        
        mButtonMainpageNewCourse.setOnClickListener(this);
        mButtonMainpageMyResults.setOnClickListener(this);
        mButtonMainpageFriends.setOnClickListener(this);
        mButtonMainpageDrivingSchool.setOnClickListener(this);
    }

    
    @Override
    public void onClick(View v) {
        switch (v.getId()){
         
        case R.id.button_mainpage_newcourse:
            startActivity(new Intent(this,newCourse.class)); 
            break;
        case R.id.button_mainpage_myresults:
            startActivity(new Intent(this,MyResults.class)); 
            break;
        case R.id.button_mainpage_friends:
            startActivity(new Intent(this,Friends.class)); 
            break;
        case R.id.button_mainpage_goals:
            startActivity(new Intent(this,Goals.class)); 
            break;

        }//switch
    }//onClick
}
